package md

import (
	"os/exec"
	"strings"
)

func getDefaultIP() string {
	cmd := exec.Command("bash", "-c", "/sbin/ifconfig `ip route | grep default | awk '{print $5}'` | grep -w inet | awk '{print $2}'")
	output, err := cmd.Output()
	if err == nil {
		return strings.TrimPrefix(string(output), "addr:")
	}
	return ""
}
